<?php

use function Clue\StreamFilter\fun;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVulsDelayTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //create
        Schema::create('vuls_delay',function(Blueprint $table){
            $table->increments('id');
            $table->integer('vuls_id');
            $table->integer('applyer')->comment('申请人');
            $table->string('reason')->comment('说明情况');
            $table->integer('auditer')->default(0)->comment('审核人');
            $table->tinyInteger('agree')->default(0)->comment('0=no,1=yes');
            $table->timestamp('delayed_at')->comment('延期时间');
            $table->timestamps();
            //索引
            $table->index('vuls_id','vuls_delay_vuls_id_foreign');
            $table->index('applyer','vuls_delay_applyer_foreign');
            $table->index('auditer','vuls_delay_auditer_foreign');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //drop
        Schema::dropIfExists('vuls_delay');
    }
}
